
def calValueAddedTax(contractPrice, originalValue):
    return (contractPrice - originalValue) / 1.05 * 0.0525

def calDeedTax(contractPrice, valueAddedTax):
    return (contractPrice - valueAddedTax) * 0.015

def calCommision(finalPrice):
    return finalPrice * 0.027

def calPureDownPayment(finalPrice, contractPrice):
    return finalPrice - calLoanQuota(contractPrice)

def calLoanQuota(contractPrice):
    return contractPrice * 0.6

def printDetails(houseName, contractPrice, finalPrice, originalPrice):
    loanQuota = calLoanQuota(contractPrice)
    pureDownPayment = calPureDownPayment(finalPrice, contractPrice)
    commision = calCommision(finalPrice)
    valueAddedTax = calValueAddedTax(contractPrice, originalPrice)
    deedTax = calDeedTax(contractPrice, valueAddedTax)
    totalDownPayment = pureDownPayment + commision + valueAddedTax + deedTax
    totalPrice = loanQuota + totalDownPayment
    print("%s: 合同价：%.2f，贷款额度：%.2f，纯首付：%.2f，中介费：%.2f，增值税：%.2f，契税：%.2f，总首付：%.2f，总房价：%.2f" \
        %(houseName, contractPrice, loanQuota, pureDownPayment, commision, valueAddedTax, deedTax, totalDownPayment, totalPrice))
    return
